package edu.bu.cs673.superkids123.children.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

@Entity
@Table(name="gameanswers")
public class Answer {
	/**
	 * @author Abdelghani Bhalla
	 */

	@Id @GeneratedValue
	@Column(name="GameAnswersID")
	private int id;
	
	@Column(name="Answer")
	private String answer;
	
	@Column(name="IsCorrectAnswer")
	private boolean isCorrect;
	
	@Column(name="IsActive")
	private boolean isActive;
	
	@ManyToOne
	@JoinColumn(name="GameQuestionsID")
	@NotFound(action=NotFoundAction.IGNORE)
	private Question question;
	
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getAnswer() {
		return answer;
	}

	public void setAnswer(String answer) {
		this.answer = answer;
	}

	public boolean isCorrect() {
		return isCorrect;
	}

	public void setCorrect(boolean isCorrect) {
		this.isCorrect = isCorrect;
	}

	public boolean isActive() {
		return isActive;
	}

	public void setActive(boolean isActive) {
		this.isActive = isActive;
	}

	public Question getQuestion() {
		return question;
	}

	public void setQuestion(Question question) {
		this.question = question;
	}

	public Answer(){
		
	}
	
}
